package tomasulo.unit;

import java.util.ArrayList;
import java.util.List;

import tomasulo.component.Register;

public class FU {
	
	private List<Register> regs = null;
	
	public FU(int cnt) {
		regs = new ArrayList<Register>();
		for (int i = 0; i < cnt; ++i)
			regs.add(new Register("F" + i));
	}
	
	public Register get(int idx) {
		return regs.get(idx);
	}

	public void checkCDB(int tick) {
		for (Register c : regs) {
			c.checkCDB(tick);
		}
	}
	
	public void reset() {
		for (Register c : regs) {
			c.reset();
		}
	}

}
